<script setup lang="ts">
import { reactive } from "vue";

const form = reactive({
  name: "xz",
  age: 19,
});
const submit = () => {
  console.log(form);
};

const list = reactive(["vue", "react"]);
const add = () => {
  list.push("angle");
};
</script>

<template>
  <div>
    <form>
      <input v-model="form.name" type="text" />
      <br />
      <input v-model="form.age" type="text" />
      <br />
      <button @click.prevent="submit">提交</button>
    </form>
    <ul>
      <li v-for="item in list" :key="item">{{ item }}</li>
    </ul>
    <button @click="add">添加</button>
  </div>
</template>

<style scoped></style>
